
const testTypeArr = [{
  0: '集成测试',
  1: '回归测试',
  2: '上线前测试',
  3: '迭代测试',
}];


const tableData =[{
  key: '1',
  name: 'mBlock',
  id:'v_0.0.0-release.1[1]',
  testtype: 0,
  testreport:'不通过',
  status:'未开始',
  startdate:'2018-04-24 00:00:00',
}, {
  key: '2',
  name: 'mBlockGo',
  id: 'v_0.0.0-release.1[2]',
  testtype: 1,
  testreport:'通过',
  status:'已完成',
  startdate:'2018-04-24 00:00:00',
}, {
  key: '3',
  name: 'MakeblockApp',
  id: 'v_0.0.0-release.1[3]',
  testtype: 3,
  testreport:'不通过',
  status:'进行中',
  startdate:'2018-04-24 00:00:00',
},
  {
    key:'4',
    name:'LaserBox',
    id:'v_0.0.0-release.1[8]',
    testtype: 4,
    testreport:'基本通过',
    status:'中断',
    startdate:'2018-04-24 00:00:00',
  },

];


const monthTotalBug = [];
for (let i = 0; i < 12; i += 1) {
  monthTotalBug.push({
    x: `${i + 1}月`,
    y: Math.floor(Math.random() * 1000) + 1200,
  });
}



const radarOriginData = [];
const nameArr = ['IDE','IoT','LaserPrinter',
'MakeblockForAndroid','MakeblockForIOS','MakeX',
'mbClass','mBlock','mBlockApp',
'mBlockForum','Neurons','New Education','TestDev','Unity3D'];
const scoreArr = [1,2,3,4,5];
const suspendedArr = scoreArr,
      coverageArr = scoreArr,
      missingArr = scoreArr,
      qualityArr = scoreArr,
      passingArr = scoreArr,
      reopenArr = scoreArr;


for (let i = 0; i < nameArr.length; i += 1) {
  radarOriginData.push({
    name: nameArr[i],
    suspended: suspendedArr[Math.floor(Math.random()*suspendedArr.length)],
    coverage: coverageArr[Math.floor(Math.random()*coverageArr.length)],
    missing: missingArr[Math.floor(Math.random()*missingArr.length)],
    quality: qualityArr[Math.floor(Math.random()*qualityArr.length)],
    passing: passingArr[Math.floor(Math.random()*passingArr.length)],
    reopen: reopenArr[Math.floor(Math.random()*reopenArr.length)],
    dddd: reopenArr[Math.floor(Math.random()*reopenArr.length)],
    dddd2: reopenArr[Math.floor(Math.random()*reopenArr.length)],
  });
}

const radarData = [];
const radarTitleMap = {
  suspended: 'BUG挂起率',
  coverage: '测试覆盖率',
  missing: '漏测率',
  quality: '提测质量',
  passing: '测试通过率',
  reopen: '回归通过率',
  dddd:'test',
  dddd2:'xxxxxxxxxx'
};
radarOriginData.forEach(item => {
  Object.keys(item).forEach(key => {
    
    if (key !== 'name') {
      radarData.push({
        name: item.name,
        label: radarTitleMap[key],
        value: item[key],
      });
    }
  });
});




export const projrctListData={
  
  testTypeArr,
  tableData,
  monthTotalBug,
  radarData,
}

export default {

projrctListData

}








